package com.test.json;

import java.util.ArrayList;
import java.util.List;

/**
 * JsonTreeNoCheckItem. <br>
 * 没有checkBox框的属性实体.
 * <p>
 * Copyright: Copyright (c) 2010-4-17 下午04:24:47
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: liuxl@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */
public class JsonTreeNoCheckItem {

	private static String FILE_CSS = "folder";

	private static String FOLDER_CSS = "folder";

	private List<JsonTreeNoCheckItem> children = null;

	private boolean expanded = false;

	private Long id;

	private String text;

	private boolean mark = false;

	public boolean isMark() {
		return mark;
	}

	public void setMark(boolean mark) {
		this.mark = mark;
	}

	public void addChildren(JsonTreeNoCheckItem jsonTreeItem) {
		if (this.children == null) {
			this.children = new ArrayList<JsonTreeNoCheckItem>();
		}
		this.children.add(jsonTreeItem);
	}

	public List<JsonTreeNoCheckItem> getChildren() {
		return this.children;
	}

	public String getCls() {
		return (this.children == null) ? JsonTreeNoCheckItem.FILE_CSS : JsonTreeNoCheckItem.FOLDER_CSS;
	}

	public Long getId() {
		return this.id;
	}

	public String getText() {
		return this.text;
	}

	public boolean isExpanded() {
		return this.expanded;
	}

	public boolean isLeaf() {
		if (this.mark) {
			return false;
		}
		return (this.children != null && !this.children.isEmpty()) ? false : true;
	}

	public void setChildren(List<JsonTreeNoCheckItem> children) {
		this.children = children;
	}

	public void setExpanded(boolean expanded) {
		this.expanded = expanded;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setLeaf(boolean leaf) {

	}

	public void setText(String text) {
		this.text = text;
	}

}
